
		 <!-- Payment Gateway -->
<?php
if(!isset($SHOP_TYPE))
	$SHOP_TYPE = null;


$intVatPayableTotal  = 0;
$intNetTotalTotal 	= 0;
//$intOrderHeaderID = $_SESSION['sesOrderID'];
//if($_SESSION['sesOrderID'] == "")
	//return;
if($strStyleSheet == TRUE){
	echo "<table class='Normal' align='left'  border='0' width='100%'>";
}	
	if(defined("PAYMENT_GATEWAY")){
		$intOrderHeaderID = $_SESSION['sesOrderID'];
	echo "<!-- ".PAYMENT_GATEWAY." -->
		<tr>
			<td colspan='4'>";
				include (MODULE . "/screen/Gateway_".PAYMENT_GATEWAY);
			echo "		
			</td>
		</tr>";

	}else{ 
	?>
		<tr>
		<td colspan='4' align='left' class='Normal'>
			<h2><i>The Order Process is now complete</i></h2>
			<h3>A confirmation email has been sent to you.</h3>
			<table border="1" bordercolor="black" align='left' class='Normal'>
				<tr>			
					<td>
						<b>Please Note Your Order Number : <?php echo $intOrderHeaderID ?></b>
					</td>
				</tr>
			</table>
		</td>
	</tr> 
	
	
	<?php
	}

echo (StartForm("welcome", "post", "actResetOrderParm","","","","frmDisplayOrder",""));
	
	//echo $_SESSION['sesOrderID'];
	$intTotal = null;
	if($intOrderHeaderID < 1)
		return;
 	include (MODULE . "/action/qrySelectOrderHeader");
echo "
	<tr>
		<td colspan='4' align='left' class='Normal'>
			<b>Thank you for ordering from ".SITE_NAME."
			<br/>Detailed below is your order.
			<br/><hr></b>
		</td>
	</tr>
	<tr>
		<td colspan='2' align='left' class='Normal'>
			<b>Please Note Your Order number:</b>
		</td>
		<td colspan='2' align='right'>
			$intOrderHeaderID
		</td>
	</tr>
	
	<tr class='Normal'>
		<td colspan='2' valign='top' class='Normal'>
			<br/><b>Invoice to:</b>
			<br/>".$myrow["ShipName"]."
			<br/>".$myrow["ShipAddress"];

				if ($myrow["ShipAddress2"]){
					echo "<br/>".$myrow["ShipAddress2"];
				}
		
echo "
			<br/>".$myrow["ShipCity"]."
			<br/>".$myrow["ShipRegion"]."
			<br/>".$myrow["ShipPostalCode"]."
		</td>

		<td colspan='2' valign='top' class='Normal'>
			<br/><b>Deliver to:</b>
			<br/>".$myrow["DeliveryName"]."
			<br/>".$myrow["DeliveryAddress"];

				if ($myrow["DeliveryAddress2"]){
					echo "<br/>".$myrow["DeliveryAddress2"];
				}
		
echo "
			<br/>".$myrow["DeliveryCity"]."
			<br/>".$myrow["DeliveryRegion"]."
			<br/>".$myrow["DeliveryPostalCode"]."
		</td>


	</tr>";
	
		if(EXTRA_ORDER_FIELD){
			
			echo "
			<tr>
				<td class='Normal'>
					<b>".EXTRA_ORDER_FIELD."</b> ".$myrow["OtherInfo"]."<br/>
				</td>
			</tr>
			";
		}
	echo "
	<tr align='center' class='Normal'>
        <td colspan='4' align='right'>
			<table width='495' border='0' cellspacing='0' cellpadding='0' class='Normal' align='left'>
				<tr align='center' height='20'>
			        <td align='left' width='230'><b>Product</b></td>
					<td align='center' width='30'><b>qty</b></td>
					<td align='center' width='60'><b>Unit Price ".CURRENCY."</b></td>
					<td align='center' width='90'><b>Net Price ".CURRENCY."</b></td>
					<td align='center' width='80'><b>VAT ".CURRENCY."</b></td>
					<td align='right' width='120'><b>Total ".CURRENCY."</b></td>
			    </tr>";
				
				include (MODULE . "/action/qrySelectOrderDetails$SHOP_TYPE");
				do{
					echo "<tr align='right' class=' CheckoutProductDetail' bgcolor=\"".switch_background($boBG)."\">
				 		<td align='left' height='40'>";
						
								if ($myrow["QuantityPerUnit"]>1){
									echo $myrow["QuantityPerUnit"]."&nbsp;";
								}
								
							echo "<span class='Small'>".$myrow["Product"];
							if($myrow["Colour"]){
								echo "&nbsp; Colour: ".$myrow["Colour"];
							}
								
							if($myrow["Size"]){
								echo "&nbsp;Size: ".$myrow["Size"];
							}
							echo "</span>
						</td>
						<td>".$myrow["Quantity"]."</td>
						<td>".number_format($myrow["NetPrice"], 2, '.', '')."</td>
				        <td>".number_format($myrow["NetTotal"], 2, '.', '')."</td>
				        <td>".number_format($myrow["VatPayable"], 2, '.', '')."</td>
						<td>".number_format($myrow["Amount"], 2, '.', '')."</td>
				    </tr>";
					$boBG = -1 - $boBG; //alternate $boBG values from -1 and 0
					$intTotal = $intTotal + $myrow["Amount"];
					$intVatPayableTotal = $intVatPayableTotal + $myrow["VatPayable"];
					$intNetTotalTotal = $intNetTotalTotal + $myrow["NetTotal"];
					$intVATRate = $myrow["VatRate"];
				} while ($myrow = mysql_fetch_array($result));
				
				
			    echo "<tr class='Normal'>
			        <td colspan='3' align='left'  height='20'>Carriage</td>";
					
					
						if (CARRIAGE !== "0.00"){
								if($SHOP_TYPE == "Trade"){
									$intNetCarriage = number_format(CARRIAGE, 2, '.', '');
									$intVATCarriage = number_format((CARRIAGE * ($intVATRate/100)), 2, '.', '');
									$intTotalCarriage = number_format((CARRIAGE + $intVATCarriage), 2, '.', '');
									$intTotal = $intTotal + $intTotalCarriage;
								}else{
									$intNetCarriage = number_format(CARRIAGE / (($intVATRate/100)+1), 2, '.', '');
									$intVATCarriage = number_format((CARRIAGE - (CARRIAGE / (($intVATRate/100)+1))), 2, '.', '');
									$intTotalCarriage = number_format(CARRIAGE, 2, '.', '');
									$intTotal = $intTotal + $intTotalCarriage;
								}
								
							echo "	
							<td align='right'>".$intNetCarriage."</td>
							<td align='right'>$intVATCarriage</td>
							<td align='right'>".number_format($intTotalCarriage, 2, '.', '')."</td>";
						}else{
							$intNetCarriage = '0';
							$intVATCarriage = '0';
							 echo "<td colspan='5' align='right' class='Small'>Included</td>";
						}
					
	
	echo "
					</td>
			    </tr>
				
				<tr class='Normal'>
			 		<td colspan='3'  height='20'>Total</td>
					<td align='right'><b>".CURRENCY.number_format($intNetTotalTotal + $intNetCarriage, 2, '.', '')."</b></td>
					<td align='right'><b>".CURRENCY.number_format($intVatPayableTotal + $intVATCarriage, 2, '.', '')."</b></td>
					<td align='right'><b>".CURRENCY.number_format($intTotal, 2, '.', '')."</b></td>
			    </tr>
			</table>
		</td>
	</tr>
	
	";
	
		if(defined("PAYMENT_GATEWAY")){
		}else{
			echo "
			<tr class='Normal'>
				<td colspan='4' align='center'>
					
					<br/>".ORDER_CONFIRMATION_MESSAGE."<br/>".ORDER_CONFIRMATION_VAT_MESSAGE."
				</td>
			</tr>
			<tr>
				<td colspan='4' align='right'>
					<input type='submit' name='cmdFinish' value='Finish'>
				</td>
			</tr>";
		}
	echo "</form>";
	//}
if($strStyleSheet == TRUE){
	echo "</table>";
}	

	if(file_exists(MODULE_SHOP_HOST . "/screen/GoogleConversion.php")){
		//include Google conversion script
		include(MODULE_SHOP_HOST . "/screen/GoogleConversion.php");
	}
	unset($_SESSION['sesProcessed']);
	//session_unregister(sesProcessed);	
?>
